import java.util.Scanner;

public class work228 {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int n, k;
        System.out.println("灯数：");
        n = sc.nextInt();
        System.out.println("人数：");
        k = sc.nextInt();

        int[] light = new int[n+1];

        for(int i=0; i<=n; i++) {
            light[i] = i;
        }

        for(int j=2; j<=k; j++) {
            for(int i=j; i<=n; i++) {
                if(i%j==0) {
                    if(light[i]!=0) {
                        light[i] = 0;
                    }else {
                        light[i] = i;
                    }
                }
            }
        }

        for(int i=1; i<=n; i++) {
            if(light[i]!=0) {
                System.out.print(i + " ");
            }
        }

    }

}
